using MediatR;
using RBAC.ErrorCode;
using System.ComponentModel.DataAnnotations;

namespace RBAC.Read.Api.Application.Command.ERP.SalesManagement.Return
{
    /// <summary>
    /// 获取退货通知单列表查询命令
    /// </summary>
    public class GetReturnNoticeListCommand : IRequest<APIResult<GetReturnNoticeListDto>>
    {
        /// <summary>
        /// 当前页码，默认第1页
        /// </summary>
        [Range(1, int.MaxValue)]
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页条数，默认10条
        /// </summary>
        [Range(1, 100)]
        public int PageSize { get; set; } = 10;

        /// <summary>
        /// 单据编码（模糊查询）
        /// </summary>
        public string? BillCode { get; set; }

        /// <summary>
        /// 客户名称（模糊查询）
        /// </summary>
        public string? CustomerName { get; set; }

        /// <summary>
        /// 销售员（模糊查询）
        /// </summary>
        public string? SalesPerson { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public string? BillStatus { get; set; }

        /// <summary>
        /// 业务状态
        /// </summary>
        public string? BusinessStatus { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime? EndDate { get; set; }
    }

    /// <summary>
    /// 退货通知单列表响应DTO
    /// </summary>
    public class GetReturnNoticeListDto
    {
        /// <summary>
        /// 分页数据列表
        /// </summary>
        public List<ReturnNoticeDto> PageDatas { get; set; } = new List<ReturnNoticeDto>();

        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }
    }

    /// <summary>
    /// 退货通知单DTO
    /// </summary>
    public class ReturnNoticeDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 单据编码
        /// </summary>
        public string? BillCode { get; set; }

        /// <summary>
        /// 业务类型
        /// </summary>
        public string? BusinessType { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        public string? CustomerName { get; set; }

        /// <summary>
        /// 仓库
        /// </summary>
        public string? Warehouse { get; set; }

        /// <summary>
        /// 单据日期
        /// </summary>
        public DateTime? BillDate { get; set; }

        /// <summary>
        /// 操作员
        /// </summary>
        public string? Operator { get; set; }

        /// <summary>
        /// 销售员
        /// </summary>
        public string? SalesPerson { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public string? BillStatus { get; set; }

        /// <summary>
        /// 审批员
        /// </summary>
        public string? Reviewer { get; set; }

        /// <summary>
        /// 退货原因
        /// </summary>
        public string? ReturnReason { get; set; }

        /// <summary>
        /// 业务状态
        /// </summary>
        public string? BusinessStatus { get; set; }

        /// <summary>
        /// 审批日期
        /// </summary>
        public DateTime? ReviewDate { get; set; }

        /// <summary>
        /// 处理方式
        /// </summary>
        public string? ProcessingMethod { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 退货物料明细数量
        /// </summary>
        public int MaterialCount { get; set; }
    }
}